<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.util.*,com.samebuilding.domain.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>  

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>

<%@ page isELIgnored="false" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>同乐吧-邀请别人</title>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="../css/public.css" rel="stylesheet" type="text/css" />
		<link href="../css/column.css" rel="stylesheet" type="text/css" />
		<link href="../css/comment.css" rel="stylesheet" type="text/css" />

<script>
function copy_clip(copy){
if (window.clipboardData){
window.clipboardData.setData("Text", copy);}
else if (window.netscape){
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
if (!clip) return;
var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
if (!trans) return;
trans.addDataFlavor('text/unicode');
var str = new Object();
var len = new Object();
var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
var copytext=copy;
str.data=copytext;
trans.setTransferData("text/unicode",str,copytext.length*2);
var clipid=Components.interfaces.nsIClipboard;
if (!clip) return false;
clip.setData(trans,null,clipid.kGlobalClipboard);}
alert("网址已复制到剪贴板");
return false;
}
function _bodyonload()
{
	if (document.dataform.real_name.value.length == 0)
	{
		openWindow('/interface/getname.php', 330, 170, '请输入真实姓名');
	}
}

function copy(v_str)
{
	if (copyToClipboard(v_str))
	{
		alert("网址复制成功！\n你可以利用快捷方式Ctrl+V键粘贴到QQ或MSN里。");
	}
}

</script>
	</head>
	<body class="body">
		<div class="pageContent">
		
			<jsp:include flush="true" page="../include/header.jsp"></jsp:include>
			
			<!-- 页面主内容 -->
			<div class="main">
			 
 <div align="center">
			<strong class="f13">复制此邀请链接地址，用QQ、MSN或其他方式发送给你的朋友；打开此网址即可加入<br />建议：不同的好友圈子请选择对应的邀请链接，以便对方找到与你的共同好友</strong>
			<%
			User user=(User)request.getSession().getAttribute("user"); 
			  int id=user.getUserNo();
			  String[] msg={"默认邀请链接：","现在同事专用邀请：","以前同事专用邀请：","大学同学专用邀请：","高中同学专用邀请：","家人亲戚专用邀请：","挚交好友专用邀请：","普通朋友专用邀请：","朋友的朋友专用邀请：","其他专用邀请："};
			 for(int i=0;i<msg.length;i++)
			 {
			 %>
			 
			<div align="center">
				<div style="margin-top:8px;width:11em;text-align: left"><%=msg[i]%></div>
			<p><span class="it_s"><input id=type<%=i%>  type="text" value=<%=basePath %>/user/register.jsp?uid=<%=id%>&type=<%=i%> size="60" class="it1" onfocus="this.className='it2';" onblur="this.className='it1';" readonly  onclick="this.select()" />
				
			<input type="button" id="btn_fb" value="复制邀请链接"  onclick="copy_clip(document.getElementById('type<%=i%>').value)" /></p>
				
			</div>
           <%} %>
			
</div>
			
			<jsp:include flush="true" page="../include/footer.jsp"></jsp:include>
				
		</div>
	</body>
</html>